package cn.zz.veggie.application.assembler;

import cn.zz.comm.util.DateTimeUtil;
import cn.zz.veggie.model.domain.User;
import cn.zz.veggie.web.types.dto.mgmt.user.MgmtUserSaveDto;

/**
 * @author zhongq
 * @since 2024/6/16
 */
public class UserAssembler {
	public static User buildUserSave(MgmtUserSaveDto dto) {
		final User u = new User();
		u.setId(dto.getId());
		u.setUsername(dto.getUsername());
		u.setPassword("123456");
		u.setMobile(dto.getMobile());
		u.setStoreName(dto.getStoreName());
		u.setStoreAddress(dto.getStoreAddress());
		u.setCreatedAt(DateTimeUtil.unixTime());
		u.setUpdatedAt(DateTimeUtil.unixTime());
		return u;
	}
}